<template name="indexsetting">
	<view class="switch" :class="lang+'layout'"  @click="shezhi()">
		<button class="settingbutton" :style="lang!='cn'?'padding-top:10rpx;font-size:30rpx':'font-size:30rpx'">
			<text>{{ $t(lang) }}：{{subject}}</text>
			 <image src="/static/index/reset.png" @click="shezhi()"></image>
		</button>
	</view>
</template>

<script>
	export default {
		name:"indexsetting",
		props: ["lang","subject"],
		data(){
				return{
					
				}
			},
		methods: {
			shezhi(event){
				console.log("shezhi kaishile")
				//this.$emit('moreBtn',event)
				var that = this;
				uni.removeStorage({
				    key: 'exam_type',
				    success: function (res) {
						uni.removeStorage({
						    key: 'kemu_type',
						    success: function (res) {
								uni.removeStorage({
								    key: 'cart_type',
								    success: function (res) {
										console.log(res,"res")
										console.log(res.errMsg,"res.errMsg")
										if(res.errMsg == "removeStorage:ok"){
											console.log("jin lu yu")
											uni.reLaunch({
												url:'../../pages/setting/setting'
											})
											uni.reLaunch({
												url:'@/pages/setting/setting'
											})
										}
								        
								    },
									fail() {
										uni.reLaunch({
											url:'../../pages/setting/setting'
										})
									}
								});	
						    },
							fail() {
								uni.reLaunch({
									url:'../../pages/setting/setting'
								})
							}
						});
				    },
					fail() {
						console.log("shebai leee");
						uni.reLaunch({
							url:'../../pages/setting/setting'
						})
					}
				});
				
				
				
			}
		}
	}
</script>

<style>
.switch {
	width: 750rpx;
	text-align: center;
	margin-top: 15rpx;
	margin-bottom: 30rpx;
}
.settingbutton {
	border-radius: 100rpx;
	display: inline-block;
	line-height: 60rpx;
	background: #0bd34e;
	color: #ffffff;
	position: relative;
}
.settingbutton image{
	width: 40rpx;
	height: 40rpx;
	position: absolute;
	display: inline-block;
	top:10rpx;
	right:20rpx;
}
.settingbutton text{
	display: inline-block;
	max-width: 600rpx;
	height: 60rpx;
	text-align: left;
	padding-right: 50rpx;
}
.kzlayout .settingbutton text{
	text-align: right;
	padding-left: 50rpx;
	padding-right: 0rpx !important;
}
.kzlayout .settingbutton image{
	right: auto;
	top:14rpx;
	left:20rpx !important;
}
.uylayout .settingbutton text{
	text-align: right;
	padding-left: 50rpx;
	padding-right: 0rpx !important;
}
.uylayout .settingbutton image{
	right: auto;
	top:14rpx;
	left:20rpx !important;
}
</style>
